package handler

import (
	"github.com/tsingshaner/gin/shared"
	v "github.com/tsingshaner/gin/validator"
)

type (
	getCourseQuery struct {
		ID shared.ID `uri:"id" binding:"required" example:"1"` // 课程ID
	}
)

func (h *handler) getCourseChain() Chain {
	return Chain{v.Params[getCourseQuery](), h.getCourse}
}

// getCourse
//
//	@Summary		课程详情
//	@Description	获取课程详情, 包含课程的实验信息
//	@Tags			课程模块
//	@Security		BearerToken
//	@Accept			json
//	@Produce		json
//	@Param			id	path		string							true	"课程ID"
//	@Success		200	{object}	getCourseQuery					"课程信息"
//	@Failure		401	{object}	resp.FailedBody[string, string]	"无权访问"
//	@Router			/courses/{id} [get]
func (h *handler) getCourse(c Ctx) {
	_ = v.GetParams[getCourseQuery](c)
}
